package com.hulk.ratel.framework.s3.config;


import com.hulk.ratel.framework.s3.config.S3FsProperties;
import com.hulk.ratel.framework.s3.template.FsTemplate;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * 文件系统服务自动配置
 *
 * @author hulk
 */
@Configuration
@ConditionalOnProperty(name = "enabled", prefix = S3FsProperties.PREFIX, havingValue = "true", matchIfMissing = true)
@EnableConfigurationProperties(S3FsProperties.class)
public class S3FsClientAutoConfiguration {


	@Bean
	@ConditionalOnMissingBean(FsTemplate.class)
	public FsTemplate fsTemplate(S3FsProperties properties) {
		return new FsTemplate(properties);
	}






}
